package com.thinkcube.edutainment.client;

import org.androidannotations.annotations.rest.Accept;
import org.androidannotations.annotations.rest.Post;
import org.androidannotations.annotations.rest.Rest;
import org.androidannotations.api.rest.MediaType;
import org.springframework.http.converter.FormHttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;

import com.thinkcube.edutainment.EdutainmentConstant;
import com.thinkcube.edutainment.domain.Coupon;
import com.thinkcube.edutainment.domain.Course;
import com.thinkcube.edutainment.domain.CourseCategory;
import com.thinkcube.edutainment.domain.MetaData;
import com.thinkcube.edutainment.domain.Package;
import com.thinkcube.edutainment.domain.Purchase;

/**
 * shanuka gayashan @Cyberlmj 2:06:25 AM Email: shanuka.gayashan@cyberlmj.com
 */
@Rest(rootUrl = EdutainmentConstant.ROOT_URL, converters = {
	FormHttpMessageConverter.class, StringHttpMessageConverter.class,
	MappingJackson2HttpMessageConverter.class } ,interceptors = { ThinkcubeInterceptor.class })
public interface CourseClient {
    /**
     * 
     * @param formfields
     *            auth_token limit filter_by{ featured top_rated latest
     *            recommended}
     * @return
     * @throws RestClientException
     * 
     */
    @Post("/api/course/filter")
    @Accept(MediaType.APPLICATION_JSON)
    Course getFiltercourses(MultiValueMap formfields)
	    throws RestClientException;

    /**
     * 
     * @param formfields
     *            auth_token term limit
     * @return
     * @throws RestClientException
     */
    @Post("/api/course/search")
    @Accept(MediaType.APPLICATION_JSON)
    Course getSearchSourses(MultiValueMap formfields)
	    throws RestClientException;
    /**
     * 
     * @param formfields auth_token limit user_id
     * @return
     * @throws RestClientException
     */

    @Post("/api/course/get-user-courses")
    @Accept(MediaType.APPLICATION_JSON)
    Course getGetMyCourses(MultiValueMap formfields) throws RestClientException;
    
    
    @Post("/api/course/get-course-categories")
    @Accept(MediaType.APPLICATION_JSON)
    CourseCategory getCategory(MultiValueMap formfields) throws RestClientException;
    
    
    @Post("/api/course/get-user-packages")
    @Accept(MediaType.APPLICATION_JSON)
    Package getPackage(MultiValueMap formfields) throws RestClientException;
    
    @Post("/api/course/get-cat-courses")
    @Accept(MediaType.APPLICATION_JSON)
    Course getGetCoursesByCat(MultiValueMap formfields) throws RestClientException;
    
    @Post("/api/course/wish-list")
    @Accept(MediaType.APPLICATION_JSON)
    MetaData getAddToWishList(MultiValueMap formfields) throws RestClientException;
    
    @Post("/api/lesson/completion-status")
    @Accept(MediaType.APPLICATION_JSON)
    MetaData markascompleted(MultiValueMap formfields) throws RestClientException;
    
    @Post("/api/payment/purchase")
    @Accept(MediaType.APPLICATION_JSON)
    Purchase purchase(MultiValueMap formfields) throws RestClientException;
    
    @Post("/api/payment/purchase")
    @Accept(MediaType.APPLICATION_JSON)
    String purchaseLesson(MultiValueMap formfields) throws RestClientException;
    
    @Post("/api/payment/validate-coupon")
    @Accept(MediaType.APPLICATION_JSON)
    Coupon validateCoupon(MultiValueMap formfields) throws RestClientException;
    
    
}
